{include file="../application/admin/view/common/header.html" /}

<!--main content start-->
<section class="main-content">
    <!--start page content-->
    <div class="row">

        <div class="col-md-12">
            <div class="panel panel-default collapsed">
                <div class="panel-body">
                    <div class="col-md-7">
                        <ul class="list-group">
                            <li class="list-group-item"><span>管理员:</span>
                                <span id="name"></span></li>
                            <li class="list-group-item"><span>性别:</span>
                                <span id="sex"></span></li>
                            <li class="list-group-item"><span>手机:</span>
                                <span id="phone"></span></li>
                            <li class="list-group-item"><span>邮箱:</span>
                                <span id="email"></span></li>
                            <li class="list-group-item"><span>角色:</span>
                                <span id="role"></span></li>
                            <li class="list-group-item last-item"><span>备注:</span>
                                <span id="content"></span></li>
                        </ul>
                        <button class="ch-btn">修改个人信息</button>
                    </div>
                </div>
            </div>
        </div>
    </div><!--end row-->


</section>
<!--end main content-->


<!--Common plugins-->
<script src="_JS_/jquery.min.js"></script>
<script src="_JS_/jquery.base64.js"></script>
<script src="_JS_/jquery.cookie.js"></script>
<script src="_JS_/bootstrap.min.js"></script>
<script src="_JS_/jasny-bootstrap.min.js"></script>
<script src="_JS_/jquery.slimscroll.min.js"></script>
<script src="_JS_/jquery.nanoscroller.min.js"></script>
<script src="_JS_/metismenu.min.js"></script>
<script src="_JS_/float-custom.js"></script>
<script type="text/javascript" src="_JS_/layer/layer.js"></script>
<script type="text/javascript" src="_JS_/laypage/laypage.js"></script>
<script type="text/javascript" src="_JS_/laydata/laydate.js"></script>
<script type="text/javascript" src="_JS_/getMyDate.js"></script>
<!-- Page-Level Scripts -->
<script>

    $(function () {
        $("#page-title").html("个人中心");
        postfile();
    })

    function postfile(text) {
        if (text == '刷新') {
            location.reload();
            return false;
        }
        $.ajax({
            type: 'get',
            url: "{:url('api/person/index')}",
            dataType: 'jsonp',
            jsonp: 'callback',
            beforeSend: function () {
                var index = layer.load(1, {
                    shade: [0.1, '#333333'] //0.1透明度的白色背景
                });
            },
            success: function (msg) {
                layer.closeAll();
                if (msg.code == 200) {
                    $("#name").text(msg.data.username);
                    if (msg.data.sex == 1) {
                        $("#sex").text('女');
                    } else if (msg.data.sex == 0) {
                        $("#sex").text('男');
                    }
                    $("#phone").text(msg.data.phone);
                    $("#email").text(msg.data.email);
                    $("#role").text(msg.data.name);
                    $("#content").text(msg.data.describe);
                } else {
                    layer.msg(msg.message, {icon: 5, time: 1000});
                }
            }
        });
        $(".ch-btn").click(function () {
            layer.open({
                type: 2,
                title: '个人信息修改',
                shadeClose: true,
                shade: 0.8,
                area: ['800px', '600px'],
                content: 'person_edit.html'
            });
        })
    }
</script>
</body>
</html>